Fix vmalloc_fault() path for x86/64 XenLinux.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 17 Aug 2005 18:14:46 +0000 (18:14 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 17 Aug 2005 18:14:46 +0000 (18:14 +0000)
There may be a deeper underlying problem w.r.t pagetable
initialisation at start of day, but this simple fix is
a good workaround until we have time to investigate
properly.

Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/arch/xen/x86_64/mm/fault.c

index 874b3afedefb9d0c3c57087c108ca42a335326cf..c0c5dc86b5e407add0152a7ddfa4cd4527b87c23 100644 (file)
@@ -250,7 +250,11 @@ static int vmalloc_fault(unsigned long address)
           happen within a race in page table update. In the later
           case just flush. */
 
-       pgd = pgd_offset(current->mm ?: &init_mm, address);
+       /* On Xen the line below does not always work. Needs investigating! */
+       /*pgd = pgd_offset(current->mm ?: &init_mm, address);*/
+       pgd = (pgd_t *)per_cpu(cur_pgd, smp_processor_id());
+       pgd += pgd_index(address);
+
        pgd_ref = pgd_offset_k(address);
        if (pgd_none(*pgd_ref))
                return -1;